import { TerminalCommandParams } from './terminalTypes'

/** 默认指令 */
export const DEFAULT_COMMANDS: TerminalCommandParams[] = [
  {
    key: 'help',
    title: 'help',
    group: 'local',
    usage: 'help [pattern]',
    description: 'Show command document.',
    example: [
      {
        des: '获取所有指令.',
        cmd: 'help'
      },
      {
        des: '获取指定组group的帮助文档，匹配键必须以“:”开头.',
        cmd: 'help :[pattern]'
      },
      {
        des: '获取指定命令的帮助文档，匹配键必须以“-”开头.',
        cmd: 'help -[pattern]'
      }
    ]
  },
  {
    key: 'linpeng',
    title: 'linpeng',
    group: 'local',
    usage: 'linpeng [pattern]',
    description: 'Welcome to the prompt.',
    example: [
      {
        des: 'Welcome to use',
        cmd: 'linpeng'
      }
    ]
  },
  {
    key: 'clear',
    title: 'clear',
    group: 'local',
    usage: 'clear [pattern]',
    description: 'Clear all content!',
    example: [
      {
        des: '清除当前面板所有内容.',
        cmd: 'clear'
      },
      {
        des: '清除命令行历史记录.',
        cmd: 'clear [-h | --history]'
      }
    ]
  },
  {
    key: 'date',
    title: 'date',
    group: 'local',
    usage: 'date [pattern]',
    description: 'Show Current Time.',
    example: [
      {
        des: '展示当前时间.',
        cmd: 'date'
      }
    ]
  },
  {
    key: 'openUrl',
    title: 'openUrl',
    group: 'local',
    usage: 'openUrl [pattern]',
    description: 'Open the url link.',
    example: [
      {
        des: '打开输入的链接.',
        cmd: 'openUrl [pattern]'
      },
      {
        des: '未输入合法链接.',
        cmd: 'openUrl'
      }
    ]
  },
  {
    key: 'code',
    title: 'code',
    group: 'local',
    usage: 'code [pattern]',
    description: 'Show code structure',
    example: [
      {
        des: '未输入合法链接',
        cmd: 'code'
      },
      {
        des: '高亮已复制到剪贴板的代码',
        cmd: 'code [-c | --clipboard]'
      }
    ]
  }
];

export const MESSAGE_CLASS = {
  SUCCESS: 'success',
  ERROR: 'error',
  INFO: 'info',
  WARN: 'warning',
  SYSTEM: 'system'
};
